		TITLE	MVPATH - Copyright (c) SLR Systems 1994

		INCLUDE	MACROS
		INCLUDE	IO_STRUC

		PUBLIC	MOVE_ECXPATH_EAX


		.DATA


		.CODE	PHASE1_TEXT

		externdef	_move_ecxpath_eax:proc

MOVE_ECXPATH_EAX	PROC
		;
		;MOVE PATH FROM ECX TO EAX, PRESERVE EAX
		;
		push	ECX
		push	EAX
		call	_move_ecxpath_eax
		add	ESP, 8
		ret

		PUSH	EDI
		MOV	EDX,EAX

		ASSUME	EDX:PTR NFN_STRUCT,EAX:PTR NFN_STRUCT
		;
		;FIRST, GET RID OF EXISTING PATH
		;
		PUSHM	ESI,EBX

		MOV	EAX,[EAX].NFN_PATHLEN
		MOV	EBX,ECX
		ASSUME	EAX:NOTHING,EBX:PTR NFN_STRUCT

		TEST	EAX,EAX
		JZ	L1$

		MOV	ECX,[EDX].NFN_TOTAL_LENGTH
		LEA	ESI,[EDX].NFN_TEXT

		SUB	ECX,EAX
		MOV	EDI,ESI

		ADD	ESI,EAX
		MOV	[EDX].NFN_TOTAL_LENGTH,ECX

		REP	MOVSB
L1$:
		;
		;NEXT MOVE ALL DOWN PATHLEN BYTES
		;
		LEA	ESI,[EDX].NFN_TEXT-1
		MOV	ECX,[EDX].NFN_TOTAL_LENGTH

		ADD	ESI,ECX
		MOV	EAX,[EBX].NFN_PATHLEN

		STD

		LEA	EDI,[EAX+ESI]

		REP	MOVSB

		CLD

		MOV	ECX,[EBX].NFN_PATHLEN
		MOV	EAX,[EDX].NFN_TOTAL_LENGTH

		MOV	[EDX].NFN_PATHLEN,ECX
		ADD	EAX,ECX

		LEA	ESI,[EBX].NFN_TEXT
		MOV	[EDX].NFN_TOTAL_LENGTH,EAX

		LEA	EDI,[EDX].NFN_TEXT
		POP	EBX

		REP	MOVSB

		POPM	ESI,EDI

		MOV	DPTR [EAX+EDX].NFN_TEXT,ECX
		MOV	EAX,EDX

		RET

MOVE_ECXPATH_EAX	ENDP


		END

